package com.lms.busi.common.controller;

import com.lms.busi.common.service.ITLmsOrganizationService;
import com.lms.busi.common.service.ITLmsStaffService;
import com.lms.common.entity.TLmsStaff;
import com.lms.common.pure.entity.ITreeNode;
import com.lms.common.web.controller.BaseController;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tLmsStaff")
@RequiredArgsConstructor
public class TLmsStaffController extends BaseController<ITLmsStaffService, TLmsStaff> {
    private final ITLmsOrganizationService lmsOrganizationService;

    @GetMapping("/getByOrganization")
    public List<ITreeNode<String>> getByOrganization() {
        // 获取组织机构树
        List<ITreeNode<String>> organizationaTreeList = lmsOrganizationService.organizationaTreeList(false);
        return this.baseService.getByOrganization(organizationaTreeList);
    }

}
